<?php include load_tpl('header');?>
<p id="breadcrumbs">
    <a href="/">首页</a> <b>»</b> 
    <span>新闻分类</span>
</p>
<form action="" method="post" id="form">
<div style="margin:4px 0 0 10px;">
  <div style="background: #547C96; color: #FFF; border-bottom: 1px solid #8EAEC3; padding: 5px; font-size: 14px; font-weight: bold;">新闻分类</div>
  <div style="background: #FCFCFC; border: 1px solid #8EAEC3; padding: 10px;">
	<table class="list">
	  <thead>
		<tr style="background-color: rgb(244, 244, 248);">
		  <td class="right">分类 ID</td>
		  <td class="left">分类名称</td>
		  <td class="left">状态</td>
		  <td class="left">创建时间</td>
		  <td class="right">操作</td>
		</tr>
	  </thead>
	  <tbody>
	 <?php if($cate_all){
			foreach($cate_all as $cate){
	?>
	<tr>
		 <td class="right"><?php echo $cate['id'];?></td>
		  <td class="left"><?php echo $cate['name'];?></td>
		  <td class="left"><?php if($cate['status']=='1') echo '启用'; else echo '禁用';?></td>
		  <td class="left"><?php echo $cate['created'];?></td>
		  <td class="right"><a class="button" href="index.php?mod=news&act=cate&go=edit&id=<?php echo $cate['id'];?>"><span>编辑</span></a><a class="button" href="index.php?mod=news&act=cate&go=del&id=<?php echo $cate['id'];?>"><span>删除</span></a></td>
	</tr>
	<?php
			}
	}else{
	?>
		<tr>
		  <td colspan="6" class="center">No results!</td>
		</tr>
	<?php } ?>
		<tr>
		<td>分类名称:</td><td align="left"><input type="text" name="name" size="90" value="<?php if(isset($cate_info)) echo $cate_info['name'];?>"/></td><td>分类状态</td><td><select name="status"><option value="0" <?php if(isset($cate_info)&&$cate_info['status']=='0') echo 'selected';?>>禁用</option><option value="1" <?php if(isset($cate_info)&&$cate_info['status']=='1') echo 'selected';?>>启用</option></select></td><td><a class="button" onclick="$('#form').submit();"><span>保存</span></a></td>
		<input type="hidden" name="cate_id" value="<?php if(isset($cate_info)) echo $cate_info['id'];?>">
		</tr>
	</tbody>
	</table>
  </div>
</div>
</form>

<?php include load_tpl('footer');?>